# Author: OMKAR PATHAK

# leaf node is the one which does not have any children

from Tree import Node

def countLeafNodes(root):
    if root is None:
        return 0
    if(root.left is None and root.right is None):
        return 1
    else:
        return countLeafNodes(root.left) + countLeafNodes(root.right)

if __name__ == '__main__':
    root = Node(1)
    root.setLeft(Node(2))
    root.setRight(Node(3))
    root.left.setLeft(Node(4))

    print('Count of leaf nodes:',countLeafNodes(root))
